package com.ruoyi.goods.service.impl;

import java.util.List;

import com.ruoyi.goods.domain.Products;
import com.ruoyi.goods.mapper.ProductsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.goods.mapper.ProductCategoriesMapper;
import com.ruoyi.goods.domain.ProductCategories;
import com.ruoyi.goods.service.IProductCategoriesService;

/**
 * 商品分类Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-01-06
 */
@Service
public class ProductCategoriesServiceImpl implements IProductCategoriesService 
{
    @Autowired
    private ProductCategoriesMapper productCategoriesMapper;
    @Autowired
    private ProductsMapper  productsMapper;
    /**
     * 查询商品分类
     * 
     * @param id 商品分类主键
     * @return 商品分类
     */
    @Override
    public ProductCategories selectProductCategoriesById(Long id)
    {
        return productCategoriesMapper.selectProductCategoriesById(id);
    }

    /**
     * 查询商品分类列表
     * 
     * @param productCategories 商品分类
     * @return 商品分类
     */
    @Override
    public List<ProductCategories> selectProductCategoriesList(ProductCategories productCategories)
    {
        return productCategoriesMapper.selectProductCategoriesList(productCategories);
    }

    /**
     * 新增商品分类
     * 
     * @param productCategories 商品分类
     * @return 结果
     */
    @Override
    public int insertProductCategories(ProductCategories productCategories)
    {
        return productCategoriesMapper.insertProductCategories(productCategories);
    }

    /**
     * 修改商品分类
     * 
     * @param productCategories 商品分类
     * @return 结果
     */
    @Override
    public int updateProductCategories(ProductCategories productCategories)
    {
        return productCategoriesMapper.updateProductCategories(productCategories);
    }

    /**
     * 批量删除商品分类
     * 
     * @param ids 需要删除的商品分类主键
     * @return 结果
     */
    @Override
    public int deleteProductCategoriesByIds(Long[] ids)
    {

        return productCategoriesMapper.deleteProductCategoriesByIds(ids);
    }

    /**
     * 删除商品分类信息
     * 
     * @param id 商品分类主键
     * @return 结果
     */
    @Override
    public int deleteProductCategoriesById(Long id)
    {

        return productCategoriesMapper.deleteProductCategoriesById(id);
    }

    @Override
    public List<ProductCategories> selecttypename(ProductCategories productCategories) {
        return productCategoriesMapper.selecttypename(productCategories);
    }
}
